namespace CSSharpPro._1009;

public class Demo1
{
    public void TestPrint()
    {
        int num = 10;
        while (num > 5)
        {
            Console.Write(num+"\t");
            num--;
        }
        
    }

    public void TestPrint2()
    {
        int num = 10;
        do
        {
            Console.Write(num + "\t");
            num--;
        } while (num>5);
    }

    public void TestPrint3()
    {
        int num = 10;
        for (int i = 1; i <= num; i++)
        {
            if (i == 7)
            {
                continue;
            }
            Console.Write(i + "\t");
        }
    }

    public void TestPrint4()
    {
        int num = 10;
        //control alt + T 获取异常
        try
        {
            Console.WriteLine(num /0);
        }
        catch (Exception e)
        {
            Console.WriteLine(e);
            throw;
        }
    }
}
